﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace sconSDK
{
    public class Output
    {
        private int m_id;
        private Scon m_scon;

        public Output(Scon scon, int id)
        {
            m_id = id;
            m_scon = scon;
        }

        public enum OutputState { Off = 0, On = 1 }
        private OutputState m_value;
        public OutputState Value
        {
            get { return m_value; }
            set
            {
                m_value = value;
                string hexVal = "&-OO" + ((int)m_id).ToString("X2") + ((m_value == OutputState.On) ? "1" : "0") + "000H";
                string retVal = m_scon.WriteAndRead(hexVal);
            }
        }
    }
}
